package cn.com.guage.huawei;

import java.util.Scanner;

public class 进制转换 {
	 public static void main(String[] args) throws Exception{
	        Scanner sc = new Scanner(System.in);
	        while(sc.hasNextLine()){
	            String s = sc.nextLine();
	            System.out.println(Integer.parseInt(s.substring(2,s.length()),16));
	        }
	    }
}
